New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: add option to create JSON info files #2192
Conversation
2a2bda1
to
40ed190
Compare
Had to think twice about that: JSON files are NOT merged, but selective information about them is collected in devices.json ... |
Do you have a reason why you use the friendly name as key and the ID as value? I would have done it the other way around, so the ID is used as ID (although it technically won't matter if I got your use-case right) |
devices.json is like a map, on what devices are available.
Idea is to search trough the keys via a fuzzy search, once a device is found more detailed information are gathered via the <device_id>.json |
86a128f
to
4fa6e5f
Compare
I'm aware of that, I just wanted to advice on changing the part in the commit message/PR description where you say "merged" to make it clearer. |
Well, I still would exchange key and value and then search through the values. |
exchanged key and value, also clarified the commit message |
@jow- please have a look |
Here is an example for resulting files https://chef.libremesh.org/download/json/ |
@blogic I moved the output to |
I would like to have a hash (sha256) of I'm also missing a version field of the json structure. I mean the api/specification of the json field. |
The approach was changed, now maps.json and overview.json are ingame to solve two issues at once: vanilla firmware upgrades and firmware search! The script became to complex to use purse shell, but as Python3 becomes (is?) a buildroot dependency anyway, that shouldn't cause any problem. If a (to be designed) release.json file is signed and contains checksums of the maps.json file, a secure chain is created as long as sha256 isn't broken. |
f8b7eff
to
4d58d3b
Compare
Now uses two Python3 scripts instead of messy shell scripts. Also a map file is created per subtarget. |
Now also handles ALT titles |
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Utilises the JSON schema generated after build as suggested in: openwrt/openwrt#2192 (comment) Ability to apply fresh images (default packages only, from openwrt) or to apply image with installed packages (from attendedsysupgrade server) Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
Please see the outcome of this years GSoC here. It's a firmware wizard which utilizes the JSON produced in this PR to allow users simple selection of firmware. It also supports images on demand for custom package selections, please have a look. |
While unmerged, patch it here openwrt/openwrt#2192 Signed-off-by: Paul Spooren <mail@aparcar.org>
This is a proof of conecpt and requires further work, it show how a device can find upgrades only in a secure way, without any extra packages, especially nothing HTTPS related. The online.sh "library" can be used for CLIs or ubus calls for Luci or other webinterfaces to come. Details about the JSON structure are explained in another PR[0]. To try the script, run `sysupgrade-online --search` or `--unattended`, the former searches for a sysupgrade (only snapshots currently), the latter searches and passes results to a download function, which then downloaded the sysupgrade. Ideally the sysupgrade would be verified aditionally via usign. [0]: openwrt#2192 Signed-off-by: Paul Spooren <mail@aparcar.org>
I created a proof of concept on how devices could find securely firmware upgrades. |
Where do these file end up? Are the JSON files really put next to the image files? |
It's not important to store the files next to the images, but putting them next to buildinfo and manifest files seemed reasonable to me. If you'd prefer so, I'd move the files to a different folder. However I'd really be in favor to have this files created by the buildbot. I see three use cases which all require up to date JSON files.
Removing the merging process from the buildroot be possible via the json overview but still, I'd much more like to see these files officially distributed at downloads.openwrt.org. |
f013c3e
to
94610a3
Compare
@jow- I removed the merging for now as this can be done somewhere else as well. Also enabled it only for buildbots by default. |
94610a3
to
c3767e8
Compare
While unmerged, patch it here openwrt/openwrt#2192 Signed-off-by: Paul Spooren <mail@aparcar.org>
The JSON info files contain details about the created firmware images per device and are stored next to the created images. The JSON files are stored as "$(IMAGE_PREFIX).json" and contain some device/image meta data as well as a list of created firmware images. An example of openwrt-ramips-rt305x-aztech_hw550-3g.json { "id": "aztech_hw550-3g", "image_prefix": "openwrt-ramips-rt305x-aztech_hw550-3g", "images": [ { "name": "openwrt-ramips-rt305x-aztech_hw550-3g-squashfs-sysupgrade.bin", "sha256": "db2b34b0ec4a83d9bf612cf66fab0dc3722b191cb9bedf111e5627a4298baf20", "type": "sysupgrade" } ], "metadata_version": 1, "supported_devices": [ "aztech,hw550-3g", "hw550-3g" ], "target": "ramips/rt305x", "titles": [ { "model": "HW550-3G", "vendor": "Aztech" }, { "model": "ALL0239-3G", "vendor": "Allnet" } ], "version_commit": "r10920+123-0cc87b3bac", "version_number": "SNAPSHOT" } Signed-off-by: Paul Spooren <mail@aparcar.org>
c3767e8
to
3934da4
Compare
Cherry-picked on master. Thanks! |
@@ -7,6 +7,13 @@ | |||
|
|||
menu "Global build settings" | |||
|
|||
config JSON_ADD_IMAGE_INFO | |||
bool "Create JSON info files per build image" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should that be per built image
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, actually even files per build profile
, as a profile may contain multiple images (factory, sysupgrade,...). Will update that
bool "Create JSON info files per build image" | ||
default BUILDBOT | ||
help | ||
The JSON info files contain information about the device and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
The generated JSON files, named after the base name of image (e.g. "openwrt-ath79-generic-8dev_carambola2..."), will be stored in the same directory as built image files.
Each JSON file contains meta information about the devices supported by a family of images
and the image files belonging to a particular family.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you I will update that
@jow- The currently missing json files on download.openwrt.org are due to the prepare step happening after target/install. I wrote that earlier in IRC
I don't see a reason why |
The JSON info files contain details about the created firmware images
per device and are stored next to the created images.
The JSON files are stored as "$(IMAGE_PREFIX).json" and contain some
device/image meta data as well as a list of created firmware images.
An example of openwrt-ramips-rt305x-aztech_hw550-3g.json
Signed-off-by: Paul Spooren mail@aparcar.org